import request from "@/utils/request";
// src/api/index.js
export const getCategoryList = () => {
	// 实际的 API 调用逻辑
	return request({
		url: '/category/list',
		method: 'get'
	});
};
// 新增热榜数据获取方法（模拟数据示例）
export const getHotList = () => {
	return Promise.resolve({
		code: 1,
		data: [{
				id: 'hot-1',
				title: '校园热门话题1',
				heat: 500
			},
			{
				id: 'hot-2',
				title: '校园热门话题2',
				heat: 400
			},
			{
				id: 'hot-3',
				title: '校园热门话题3',
				heat: 300
			}
		]
	});
};
//登陆
export const getLogin = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/miniLogin',
		method: 'POST',
		data
	})
}

//会员登录
export const getRegister = (data) => {
	return request({
		url: '/api/user/login',
		method: 'POST',
		data
	})
}
/**
 * 首页获取分类+获取轮播图
 */
export const getClassify = () => {
	return request({
		url: "/api/front/hitch/passengerManager/grid",
		method: 'POST'
	})
}
// 获取商品类别
export const getProductsType = () => {
	return request({
		url: "/api/front/hitch/passengerManager/getProductsType",
		method: 'POST'
	})
}
//根据楼栋id 查询对应的零食商品
export const getProductsByBuilding = (id) => {
	return request({
		url: "/api/front/hitch/passengerManager/getProductsByBuilding",
		method: 'GET',
		data: {
			id
		}
	})
}

export const getSetOrder = (data) => {
	return request({
		url: "/api/info/setOrder",
		method: 'POST',
		data
	})
}

export const getSchoolList = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/schoolList',
		method: 'POST',
		data
	})
}
// 联系客服

export const getLinkkf = (data) => {
	return request({
		url: '/api/tools/linkkf',
		method: 'POST',
		data
	})
}
// 隐私协议
export const getSecret = () => {
	return request({
		url: '/api/tools/secret',
		method: 'POST'
	})
}
// 关于我们
export const getAbout = () => {
	return request({
		url: '/api/tools/about',
		method: 'POST'
	})
}

//首页通告
export const getNotice = () => {
	return request({
		url: '/api/indexwx/notice',
		method: 'POST',
		data: {}
	})
}

//首页轮播图
export const getSwiperImg = (data) => {
	return request({
		url: "/api/indexwx/banner",
		method: "POST",
		data
	})
}

//超市列表
export const getShopList = (data) => {
	return request({
		url: '/api/dorm/list',
		method: "POST",
		data
	})
}

//超市详情
export const getShopDetail = (data) => {
	return request({
		url: '/api/dorm/dormDetail',
		method: "POST",
		data
	})
}


//超市tab
export const getProductClassify = () => {
	return request({
		url: '/api/dorm/dormCat',
		method: "POST"
	})
}

//
export const getCircleList = (data) => {
	return request({
		url: '/api/circle/list',
		method: "POST",
		data
	})
}


export const getCirclePDList = (data) => {
	return request({
		url: '/api/circle/pdlist',
		method: "POST",
		data
	})
}




//申请接单
export const getapplyOrder = (data) => {
	return request({
		url: "/api/userwx/applyOrder",
		method: "POST",
		data
	})
}

//修改学校


export const getsetSchool = (data) => {
	return request({
		url: "/api/front/hitch/passengerManager/setSchool",
		method: "POST",
		data
	})
}

//点赞
export const setLike = (data) => {
	return request({
		url: '/api/circle/setLike',
		method: "POST",
		data
	})
}

//取消点赞
export const setdelLike = (data) => {
	return request({
		url: '/api/circle/delLike',
		method: "POST",
		data
	})
}

//删除校圈
export const delCircle = (data) => {
	return request({
		url: '/api/circle/delCircle',
		method: "POST",
		data
	})
}


//发布
export const postNeed = (data) => {
	return request({
		url: '/api/info/addReport',
		method: "POST",
		data
	})
}

// 意见反馈

export const postaddOpinion = (data) => {
	return request({
		url: '/api/tools/addOpinion',
		method: "POST",
		data
	})
}

// 获取楼栋地址

export const postfloorList = (data) => {
	return request({
		url: '/api/address/floorList',
		method: "POST",
		data
	})
}

// 添加修改资料

export const postupadddzinfot = (data) => {
	return request({
		url: '/api/address/upadddzinfo',
		method: "POST",
		data
	})
}

// 我的收获地址

export const postaddresslistt = (data) => {
	return request({
		url: '/api/address/addresslist',
		method: "POST",
		data
	})
}

//删除地址


export const postdeladdress = (data) => {
	return request({
		url: '/api/address/deladdress',
		method: "POST",
		data
	})
}

export const postaddressinfo = (data) => {
	return request({
		url: '/api/address/addressinfo',
		method: "POST",
		data
	})
}
// 实名认证

export const postrealName = (data) => {
	return request({
		url: '/api/userwx/realName',
		method: "POST",
		data
	})
}
// 实名认证状态

export const postrealNamestatus = () => {
	return request({
		url: '/api/userwx/realNamestatus',
		method: "POST",
	})
}

// 订单列表

export const postorderList = (data) => {
	return request({
		url: '/api/order/orderList',
		method: "POST",
		data
	})
}

// 取消订单

export const postcancelOrder = (data) => {
	return request({
		url: '/api/info/cancelOrder',
		method: "POST",
		data
	})
}

//  即将到达

export const orderComming = (data) => {
	return request({
		url: '/api/order/comming',
		method: "POST",
		data
	})
}

export const getDetail = (data) => {
	return request({
		url: '/api/circle/artDetail',
		method: 'POST',
		data
	})
}

//获取快递列表
export const getExpressageList = (data) => {
	return request({
		url: '/api/info/expressList',
		method: 'POST',
		data
	})
}

// 发送评论
export const sendComment = (data) => {
	return request({
		url: '/api/circle/addComment',
		method: 'POST',
		data
	})
}

//获取评论列表
export const getCommentList = (data) => {
	return request({
		url: '/api/circle/artCommList',
		method: 'POST',
		data
	})
}

export const addCircle = (data) => {
	return request({
		url: '/api/circle/addCircle',
		method: 'POST',
		data
	})
}

export const getKdList = () => {
	return request({
		url: '/api/info/expressList',
		method: 'POST',
		data: {}
	})
}

export const getGoodsSize = (data) => {
	return request({
		url: '/api/info/sizeList',
		method: 'POST',
		data
	})
}

export const getGoods = (data) => {
	return request({
		url: '/api/dorm/dormGoods',
		method: 'POST',
		data
	})
}

export const getInfoList = (data) => {
	return request({
		url: '/api/info/artList',
		method: 'POST',
		data
	})
}

export const getInfoDetail = (data) => {
	return request({
		url: '/api/info/artDetail',
		method: 'POST',
		data
	})
}

export const getHotelList = (data) => {
	return request({
		url: '/api/info/hotelList',
		method: 'POST',
		data
	})
}
export const getHotelDetail = (data) => {
	return request({
		url: '/api/info/hotelDetail',
		method: 'POST',
		data
	})
}
export const addWxFriends = (data) => {
	return request({
		url: '/api/circle/addFriend',
		method: 'POST',
		data
	})
}
// 订单详情
export const postorderDetail = (data) => {
	return request({
		url: '/api/order/orderDetail',
		method: "POST",
		data
	})
}
// 消息

export const postlist = (data) => {
	return request({
		url: '/api/message/list',
		method: "POST",
		data
	})
}
// 
// 校园兼职

export const postjobList = (data) => {
	return request({
		url: '/api/info/jobList',
		method: "POST",
		data
	})
}
// 发布校园兼职
export const postaddReport = (data) => {
	return request({
		url: '/api/info/addReport',
		method: "POST",
		data
	})
}

// 订单完成

export const postfinishOrder = (data) => {
	return request({
		url: '/api/order/finishOrder',
		method: "POST",
		data
	})
}

/*消息*/
export const getMesslist = () => {
	return request({
		url: '/api/message/firstList',
		method: "POST",
		data
	})
}

// 支付相关

/* 成为会员*/
export const userMoney = () => {
	return request({
		url: '/api/recharge/userMoney',
		method: "get"
	})
}

/* 创建订单并发起支付请求 */
export const recharge = () => {
	return request({
		url: '/api/recharge/submit',
		method: "get"
	})
}

/*  会员余额信息 */
export const getUserMoney = () => {
	return request({
		url: '/api/userwx/getUserMoney',
		method: "get"
	})
}

/*   佣金比例 */
export const rateList = (data) => {
	return request({
		url: '/api/userwx/rateList',
		method: "post",
		data
	})
}

/*    余额明细 */
export const moneylog = (data) => {
	return request({
		url: '/api/tools/moneylog',
		method: "post",
		data
	})
}

/*    余额提现创建订单并发起支付请求 */
export const withdrawSubmit = (data) => {
	return request({
		url: '/api/withdraw/submit',
		method: "POST",
		data
	})
}

/**
 * 零食订单
 */
export const getLSorderList = (data) => {
	return request({
		url: '/api/dorm/orderList',
		method: "POST",
		data
	})
}

/**
 * 零食订单删除
 */
export const getLSorderDel = (data) => {
	return request({
		url: '/api/dorm/orderDel',
		method: "POST",
		data
	})
}

/**
 * 零食订单删除
 */
export const orderDetail = (data) => {
	return request({
		url: '/api/order/orderDetail',
		method: "POST",
		data
	})
}


// 宿舍超市微信支付
export const getPaymentInfo = (data) => {
	return request({
		url: '/api/front/hitch/pay/payment',
		method: "POST",
		data
	})
}
// 余额支付
export const getYueZhiFu = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/yuezhifu',
		method: "POST",
		data
	})
}

// 根据商品类别和楼栋进行查询对应的商品
export const getProductsByCategoryAndBuilding = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/getProductsByCategoryAndBuilding',
		method: 'POST',
		data
	})
}


// 校园订单微信支付
export const getPaymentInfoTo = (data) => {
	return request({
		url: '/api/front/hitch/pay/paymentTo',
		method: "POST",
		data
	})
}

/**
 * 获取当前用户所在学校的所有订单
 */
export const getCampusOrder = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/getCampusOrder',
		method: "POST",
		data
	})
}

/**
 * 关于校园订单接单
 */
export const jieCampusOrder = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/jieCampusOrder',
		method: "POST",
		data
	})
}
// 完成订单
export const wanChengCompleteOrder = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/wanChengCompleteOrder',
		method: "POST",
		data
	})
}
// 根据订单编号修改订单追加金额
export const updateAdditionalAmount = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/updateAdditionalAmount',
		method: "POST",
		data
	})
}
// 校园订单追加金额支付.
export const getPaymentInfoSan = (data) => {
	return request({
		url: '/api/front/hitch/pay/paymentSan',
		method: "POST",
		data
	})
}

// 追击订单金额表中添加数据
export const addorderRewardAddition = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/addorderRewardAddition',
		method: "POST",
		data
	})
}

// 追加之后修改订单金额
export const updateOrderrewardAmount = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/updateOrderrewardAmount',
		method: "POST",
		data
	})
}

// 微信退款
export const refund = (orderNo, refundAmount) => {
	return request({
		url: `/api/front/hitch/pay/refund?orderNo=${orderNo}&refundAmount=${refundAmount}`,
		method: "POST"

	})
}

// 余额退款
export const useBalancePayRefund = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/useBalancePayRefund',
		method: "POST",
		data
	})
}

// 根据订单id删除订单
export const deleteCamorder = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/deleteCamorder',
		method: "POST",
		data
	})
}
// 根据校园订单编号进行删除 
export const deleteCampusOrder = (data) => {
	return request({
		url: '/api/front/hitch/passengerManager/deleteCampusOrder',
		method: "POST",
		data
	})
}
// 判断当前用户是否具有接单资格
export const isJieDanStatus = () => {
	return request({
		url: '/api/front/hitch/passengerManager/isJieDanStatus',
		method: "POST"
	})
}